<template>
  <div class="property-panel">
    <h2>属性面板</h2>
    {{ panelCurNodeData }}
  </div>
</template>

<script setup lang="ts">
import { computed } from 'vue'

const props = defineProps({
  lf: Object,
  curNodeData: {
    type: Object,
    defaults: {},
  },
})
const { lf } = props
const panelCurNodeData = computed(() => props.curNodeData)
console.log('property-panel', panelCurNodeData)

// 更新属性
const updateProperty = (id: string, data: any) => {
  const node = lf?.graphModel.nodesMap[id]
  const edge = lf?.graphModel.edgesMap[id]
  if (node) {
    node.model.setProperties(Object.assign(node.model.properties, data))
  } else if (edge) {
    edge.model.setProperties(Object.assign(edge.model.properties, data))
  }
}
// 隐藏属性面板
const hidePropertyPanel = () => {
  // setNodeData(undefined);
}
</script>
